<?php
/*********************************************************************************
 * SugarCRM is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
$dictionary['edanz_Rates'] = array(
	'table'=>'edanz_rates',
	'audited'=>true,
	'fields'=>array (
		'task_type' => array (
			'name' => 'task_type',
			'vname' => 'LBL_TASK_TYPE',
			'type' => 'enum',
			'options' => 'fee_type_dom',
			'len'=> 100,
			'required' => true,
            'audited' => true,
		),
		'service' => array (
                        'name' => 'service',
                        'vname' => 'LBL_SERVICE',
                        'type' => 'enum',
                        'options' => 'service_type_list',
                        'len' => 100,
                        'required' => true,
                        'audited' => true,
                ),
		'unit_type' => array (
                        'name' => 'unit_type',
                        'vname' => 'LBL_UNIT_TYPE',
                        'type' => 'enum',
                        'options' => 'unit_type_list',
                        'len' => 100,
                        'required' => true,
                        'audited' => true,
                ),
        'business_region' => array (
                'name' => 'business_region',
                'vname' => 'LBL_BUSINESS_REGION',
                'type' => 'enum',
                'options' => 'business_regions',
                'len' => '100',
                'required' => true,
                'audited' => true,
        ),
		'rate' => array (
			'name' => 'rate',
			'vname' => 'LBL_RATE',
			'type' => 'decimal',
			'dbType' => 'double',
			'required' => true,
            'audited' => true,
		),
		'speed' => array (
			'name' => 'speed',
			'vname' => 'LBL_SPEED',
			'type' => 'enum',
			'options'=>'speed_list',
			'required' => true,
			'audited' => true,
		),
		'complexity' => array (
			'name' => 'complexity',
			'vname' => 'LBL_COMPLEXITY',
			'type' => 'enum',
			'options'=>'complexity_list',
			'required' => true,
			'audited' => true,
		),
		'applies_from' => array (
			'name' => 'applies_from',
			'vname' => 'LBL_APPLIES_FROM',
			'type' => 'varchar',
			'required' => false,
		),
		'applies_to' => array (
			'name' => 'applies_to',
			'vname' => 'LBL_APPLIES_TO',
			'type' => 'varchar',
			'required' => false,
		),
		'total_size_from' => array (
			'name' => 'total_size_from',
			'vname' => 'LBL_TOTAL_SIZE_FROM',
			'type' => 'varchar',
			'required' => false,
		),
		'total_size_to' => array (
			'name' => 'total_size_to',
			'vname' => 'LBL_TOTAL_SIZE_TO',
			'type' => 'varchar',
			'required' => false,
		),
		'unit'=>array(
			'name' => 'unit',
			'vname' => 'LBL_UNIT',
			'type' => 'varchar',
			'audited' => true,
		)
	),
	'relationships'=>array (
	),
	'optimistic_locking'=>true,
);

// Security Suite Groups
global $beanList;
if (isset($beanList['SecurityGroups'])) {
	$dictionary["edanz_Rates"]["fields"]["securitygroups_edanz_rates"] = array (
	  'name' => 'securitygroups_edanz_rates',
	  'type' => 'link',
	  'relationship' => 'securitygroups_edanz_rates',
	  'source' => 'non-db',
	  'vname' => 'LBL_SECURITYGROUPS_SUBPANEL_TITLE',
	);
	$dictionary["edanz_Rates"]["relationships"]["securitygroups_edanz_rates"] = array (
		'lhs_module' => 'SecurityGroups',
		'lhs_table' => 'securitygroups',
		'lhs_key' => 'id',
		'rhs_module' => 'edanz_Rates',
		'rhs_table' => 'edanz_rates',
		'rhs_key' => 'id',
		'join_table' => 'securitygroups_records',
		'join_key_lhs' => 'securitygroup_id',
		'join_key_rhs' => 'record_id',
		'relationship_type' => 'many-to-many',
		'relationship_role_column' => 'module',
		'relationship_role_column_value' => 'edanz_Rates',
	);
}

$dictionary["edanz_Rates"]["fields"]["fees"] = array (
				'name' => 'fees',
				'vname' => 'LBL_FEES_SUBPANEL_TITLE',
				'type' => 'link',
				'relationship' => 'edanz_rates_fees',
				'source' => 'non-db',
	  
	);
$dictionary["edanz_Rates"]["relationships"]["edanz_rates_fees"] = array (
				'lhs_module'=> 'edanz_Rates',
				'lhs_table'=> 'edanz_rates',
				'lhs_key' => 'id',
				'rhs_module'=> 'edanz_Fees' ,
				'rhs_table'=> 'edanz_fees',
				'rhs_key' => 'rate_id',
				'relationship_type'=>'many-to-one'
	  
	);	
if (!class_exists('VardefManager')){
	require_once('include/SugarObjects/VardefManager.php');
}
VardefManager::createVardef('edanz_Rates','edanz_Rates', array('basic'));

